const express = require("express");
const http = require("http");

import MiddlewareRouter from "@/router/middlewareRoute"
import log4js from "@/util/log.util"
import config from "@/util/config.util"

const logger = log4js.getLogger("default");

const app = express();

new MiddlewareRouter(app, config);

config.print(logger);

const httpServer = http.createServer(app);

httpServer.listen(config.middlewarePort, () => {
    logger.info(`√ Server is running on http://${config.middlewareIp}:${config.middlewarePort}${config.contextPath}`);
});
